/**
 * COPYRIGHT HangZhou Trustway Technology Company Limited
 * All right reserved.
 */
package com.robam.apollotest.apollotest;

import com.ctrip.framework.apollo.ConfigService;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description
 * @Author 薛铁琪
 * @CreateTime 2020-10-09 12:53
 * @Version 1.0
 */
@Slf4j
public class ClientUrlConfig {
    public void init() {
        this.initSet("spring.profiles.active"//日志打印策略需要 test dev prod三种
                , "logging.config"
                , "robam.component.log.size"
                , "robam.component.log.contextname"
                , "robam.component.log.path"
                , "robam.component.log.day"
                , "robam.component.log.consolelevel"
                , "robam.component.log.debugfile"
                , "robam.component.log.infofile"
                , "robam.component.log.warnfile"
                , "robam.component.log.errorfile"
                , "robam.component.log.allfilelevel"
                , "robam.component.log.logstash.destination"
                , "robam.component.log.logstash.level");
    }

    private void initSet(String... keys) {
        for (String key : keys) {
            String val = ConfigService.getAppConfig().getProperty(key, null);
            log.info(key + "============" + val);
            System.setProperty(key, val);
        }
    }
}
